
import 'dart:convert';
import 'dart:ffi';

import 'package:dio/dio.dart';


import '../config/dioConfig.dart';

Future<Map> getGoodsApi() async {
  var res = await HttpManager.getInstance().get(
    "/goods/getAll",
    option: Options(responseType: ResponseType.plain),
  );
  return jsonDecode(res.toString());
}


Future<Map> getCateGoodsApi() async {
  var res = await HttpManager.getInstance().get(
    "/cate/getAllMerged",
    option: Options(responseType: ResponseType.plain),
  );
  return jsonDecode(res.toString());
}

Future<Map> getGoodsDetailApi(int id) async {
  var res = await HttpManager.getInstance().get(
    "/goods/getById/${id}",
    option: Options(responseType: ResponseType.plain),
  );
  return jsonDecode(res.toString());
}

Future<Map> getSkuById(int id) async {
  var res = await HttpManager.getInstance().get(
    "/goods/getSkuById//${id}",
    option: Options(responseType: ResponseType.plain),
  );
  return jsonDecode(res.toString());
}